package org.example.demo.raw;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.fisco.bcos.sdk.abi.FunctionReturnDecoder;
import org.fisco.bcos.sdk.abi.TypeReference;
import org.fisco.bcos.sdk.abi.datatypes.Address;
import org.fisco.bcos.sdk.abi.datatypes.Bool;
import org.fisco.bcos.sdk.abi.datatypes.Event;
import org.fisco.bcos.sdk.abi.datatypes.Function;
import org.fisco.bcos.sdk.abi.datatypes.Type;
import org.fisco.bcos.sdk.abi.datatypes.Utf8String;
import org.fisco.bcos.sdk.abi.datatypes.generated.Bytes32;
import org.fisco.bcos.sdk.abi.datatypes.generated.Uint256;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple1;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple3;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple4;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple5;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple6;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple7;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple8;
import org.fisco.bcos.sdk.client.Client;
import org.fisco.bcos.sdk.contract.Contract;
import org.fisco.bcos.sdk.crypto.CryptoSuite;
import org.fisco.bcos.sdk.crypto.keypair.CryptoKeyPair;
import org.fisco.bcos.sdk.eventsub.EventCallback;
import org.fisco.bcos.sdk.model.CryptoType;
import org.fisco.bcos.sdk.model.TransactionReceipt;
import org.fisco.bcos.sdk.model.callback.TransactionCallback;
import org.fisco.bcos.sdk.transaction.model.exception.ContractException;

@SuppressWarnings("unchecked")
public class EducationCertification extends Contract {
    public static final String[] BINARY_ARRAY = {"6080604052600160035534801561001557600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612098806100656000396000f3006080604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306f5497e146100a957806351640fee146100d6578063663b3e22146102cb578063a0bdb00314610509578063a6c807a914610534578063b99b8258146106a1578063c3b451a21461080a578063d7037c2c1461085d578063f7b9d3a21461098c578063f851a44014610a65575b600080fd5b3480156100b557600080fd5b506100d460048036038101908080359060200190929190505050610abc565b005b3480156100e257600080fd5b5061010160048036038101908080359060200190929190505050610ca7565b60405180806020018060200180602001806020018615151515815260200185810385528a818151815260200191508051906020019080838360005b8381101561015757808201518184015260208101905061013c565b50505050905090810190601f1680156101845780820380516001836020036101000a031916815260200191505b50858103845289818151815260200191508051906020019080838360005b838110156101bd5780820151818401526020810190506101a2565b50505050905090810190601f1680156101ea5780820380516001836020036101000a031916815260200191505b50858103835288818151815260200191508051906020019080838360005b83811015610223578082015181840152602081019050610208565b50505050905090810190601f1680156102505780820380516001836020036101000a031916815260200191505b50858103825287818151815260200191508051906020019080838360005b8381101561028957808201518184015260208101905061026e565b50505050905090810190601f1680156102b65780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390f35b3480156102d757600080fd5b506102f660048036038101908080359060200190929190505050610f6b565b604051808981526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018060200180602001806020018060200187600019166000191681526020018615151515815260200185810385528b818151815260200191508051906020019080838360005b83811015610392578082015181840152602081019050610377565b50505050905090810190601f1680156103bf5780820380516001836020036101000a031916815260200191505b5085810384528a818151815260200191508051906020019080838360005b838110156103f85780820151818401526020810190506103dd565b50505050905090810190601f1680156104255780820380516001836020036101000a031916815260200191505b50858103835289818151815260200191508051906020019080838360005b8381101561045e578082015181840152602081019050610443565b50505050905090810190601f16801561048b5780820380516001836020036101000a031916815260200191505b50858103825288818151815260200191508051906020019080838360005b838110156104c45780820151818401526020810190506104a9565b50505050905090810190601f1680156104f15780820380516001836020036101000a031916815260200191505b509c5050505050505050505050505060405180910390f35b34801561051557600080fd5b5061051e611240565b6040518082815260200191505060405180910390f35b34801561054057600080fd5b50610575600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611246565b604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001806020018060200185815260200184151515158152602001838103835287818151815260200191508051906020019080838360005b838110156105fb5780820151818401526020810190506105e0565b50505050905090810190601f1680156106285780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b83811015610661578082015181840152602081019050610646565b50505050905090810190601f16801561068e5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b3480156106ad57600080fd5b50610808600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080356000191690602001909291905050506113d9565b005b34801561081657600080fd5b5061084360048036038101908080359060200190929190803560001916906020019092919050505061185b565b604051808215151515815260200191505060405180910390f35b34801561086957600080fd5b5061089e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118a5565b604051808060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156108e85780820151818401526020810190506108cd565b50505050905090810190601f1680156109155780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b8381101561094e578082015181840152602081019050610933565b50505050905090810190601f16801561097b5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561099857600080fd5b50610a63600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190505050611ac5565b005b348015610a7157600080fd5b50610a7a611ef9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ba6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f4f6e6c792061646d696e2063616e20706572666f726d2074686973206163746981526020017f6f6e00000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6002600082815260200190815260200160002060070160009054906101000a900460ff161515610c3e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f436572746966696361746520697320616c7265616479207265766f6b6564000081525060200191505060405180910390fd5b60006002600083815260200190815260200160002060070160006101000a81548160ff0219169083151502179055507fefa6c5f47ac2523bb4db18032377bf7fdce0fa9d86eddcae1ca9bba38be615d7816040518082815260200191505060405180910390a150565b606080606080600080600260008881526020019081526020016000209050806002018160030182600401836005018460070160009054906101000a900460ff16848054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d7c5780601f10610d5157610100808354040283529160200191610d7c565b820191906000526020600020905b815481529060010190602001808311610d5f57829003601f168201915b50505050509450838054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e185780601f10610ded57610100808354040283529160200191610e18565b820191906000526020600020905b815481529060010190602001808311610dfb57829003601f168201915b50505050509350828054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610eb45780601f10610e8957610100808354040283529160200191610eb4565b820191906000526020600020905b815481529060010190602001808311610e9757829003601f168201915b50505050509250818054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f505780601f10610f2557610100808354040283529160200191610f50565b820191906000526020600020905b815481529060010190602001808311610f3357829003601f168201915b50505050509150955095509550955095505091939590929450565b60026020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffff","ffffffffffffffffffffffffffffff1690806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110435780601f1061101857610100808354040283529160200191611043565b820191906000526020600020905b81548152906001019060200180831161102657829003601f168201915b505050505090806003018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110e15780601f106110b6576101008083540402835291602001916110e1565b820191906000526020600020905b8154815290600101906020018083116110c457829003601f168201915b505050505090806004018054600181600116156101000203166002900480601f01602080910402602001604052809291908181526020018280546001816001161561010002031660029004801561117f5780601f106111545761010080835404028352916020019161117f565b820191906000526020600020905b81548152906001019060200180831161116257829003601f168201915b505050505090806005018054600181600116156101000203166002900480601f01602080910402602001604052809291908181526020018280546001816001161561010002031660029004801561121d5780601f106111f25761010080835404028352916020019161121d565b820191906000526020600020905b81548152906001019060200180831161120057829003601f168201915b5050505050908060060154908060070160009054906101000a900460ff16905088565b60035481565b60016020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113185780601f106112ed57610100808354040283529160200191611318565b820191906000526020600020905b8154815290600101906020018083116112fb57829003601f168201915b505050505090806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113b65780601f1061138b576101008083540402835291602001916113b6565b820191906000526020600020905b81548152906001019060200180831161139957829003601f168201915b5050505050908060030154908060040160009054906101000a900460ff16905085565b6113e1611f1e565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611bb7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f4f6e6c792061646d696e2063616e20706572666f726d2074686973206163746981526020017f6f6e00000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff16151515611c7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53747564656e74207265636f726420616c72656164792065786973747300000081525060200191505060405180910390fd5b60a0604051908101604052808673ffffffffffffffffffffffffffffffffffffffff16815260200185815260200184815260200183815260200160011515815250905080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001019080519060200190611d62929190611f7f565b506040820151816002019080519060200190611d7f929190611f7f565b506060820151816003015560808201518160040160006101000a81548160ff0219169083151502179055509050507fbabae0db779d8abaa6596777f549d70ac87aa540290f1aafff028da31b0f24c985858585604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611e4e578082015181840152602081019050611e33565b50505050905090810190601f168015611e7b5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015611eb4578082015181840152602081019050611e99565b50505050905090810190601f168015611ee15780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a15050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6101006040519081016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160608152602001606081526020016060815260200160608152602001600080191681526020016000151581525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611fc057805160ff1916838001178555611fee56b82800160010185558215611fee579182015b82811115611fed578251825591602001919060010190611fd2565b5b509050611ffb9190612047565b5090565b60a060405190810160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016060815260200160608152602001600081526020016000151581525090565b61206991905b8082111561206557600081600090555060010161204d565b5090565b905600a165627a7a72305820d78f4dad97f1771d2a3ed8f152a70cc2b9e28c6c33d515765daf96a205f443310029"};

    public static final String BINARY = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", BINARY_ARRAY);

    public static final String[] SM_BINARY_ARRAY = {};

    public static final String SM_BINARY = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", SM_BINARY_ARRAY);

    public static final String[] ABI_ARRAY = {"[{\"constant\":false,\"inputs\":[{\"name\":\"_certificateId\",\"type\":\"uint256\"}],\"name\":\"revokeCertificate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_certificateId\",\"type\":\"uint256\"},{\"name\":\"_certificateType\",\"type\":\"string\"},{\"name\":\"_certificateNumber\",\"type\":\"string\"},{\"name\":\"_issueDate\",\"type\":\"string\"},{\"name\":\"_institution\",\"type\":\"string\"},{\"name\":\"_hash\",\"type\":\"bytes32\"},{\"name\":\"_isValid\",\"type\":\"bool\"}],\"name\":\"updateCertificate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_certificateId\",\"type\":\"uint256\"}],\"name\":\"getCertificate\",\"outputs\":[{\"name\":\"certificateType\",\"type\":\"string\"},{\"name\":\"certificateNumber\",\"type\":\"string\"},{\"name\":\"issueDate\",\"type\":\"string\"},{\"name\":\"institution\",\"type\":\"string\"},{\"name\":\"isValid\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"certificates\",\"outputs\":[{\"name\":\"id\",\"type\":\"uint256\"},{\"name\":\"studentId\",\"type\":\"address\"},{\"name\":\"certificateType\",\"type\":\"string\"},{\"name\":\"certificateNumber\",\"type\":\"string\"},{\"name\":\"issueDate\",\"type\":\"string\"},{\"name\":\"institution\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"bytes32\"},{\"name\":\"isValid\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"nextCertificateId\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"students\",\"outputs\":[{\"name\":\"studentId\",\"type\":\"address\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"education\",\"type\":\"string\"},{\"name\":\"graduationYear\",\"type\":\"uint256\"},{\"name\":\"exists\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_studentId\",\"type\":\"address\"},{\"name\":\"_certificateType\",\"type\":\"string\"},{\"name\":\"_certificateNumber\",\"type\":\"string\"},{\"name\":\"_issueDate\",\"type\":\"string\"},{\"name\":\"_institution\",\"type\":\"string\"},{\"name\":\"_hash\",\"type\":\"bytes32\"}],\"name\":\"issueCertificate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_certificateId\",\"type\":\"uint256\"},{\"name\":\"_hash\",\"type\":\"bytes32\"}],\"name\":\"verifyCertificate\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_studentId\",\"type\":\"address\"}],\"name\":\"getStudentRecord\",\"outputs\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"education\",\"type\":\"string\"},{\"name\":\"graduationYear\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_studentId\",\"type\":\"address\"},{\"name\":\"_name\",\"type\":\"string\"},{\"name\":\"_education\",\"type\":\"string\"},{\"name\":\"_graduationYear\",\"type\":\"uint256\"}],\"name\":\"createStudentRecord\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"studentId\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"name\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"education\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"graduationYear\",\"type\":\"uint256\"}],\"name\":\"StudentRecordCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"certificateId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"studentId\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"certificateType\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"certificateNumber\",\"type\":\"string\"}],\"name\":\"CertificateIssued\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"certificateId\",\"type\":\"uint256\"}],\"name\":\"CertificateRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"certificateId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"certificateType\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"certificateNumber\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"issueDate\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"institution\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"hash\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"isValid\",\"type\":\"bool\"}],\"name\":\"CertificateUpdated\",\"type\":\"event\"}]"};

    public static final String ABI = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", ABI_ARRAY);

    public static final String FUNC_REVOKECERTIFICATE = "revokeCertificate";

    public static final String FUNC_GETCERTIFICATE = "getCertificate";

    public static final String FUNC_CERTIFICATES = "certificates";

    public static final String FUNC_NEXTCERTIFICATEID = "nextCertificateId";

    public static final String FUNC_STUDENTS = "students";

    public static final String FUNC_ISSUECERTIFICATE = "issueCertificate";

    public static final String FUNC_VERIFYCERTIFICATE = "verifyCertificate";

    public static final String FUNC_GETSTUDENTRECORD = "getStudentRecord";

    public static final String FUNC_CREATESTUDENTRECORD = "createStudentRecord";

    public static final String FUNC_ADMIN = "admin";

    public static final String FUNC_UPDATECERTIFICATE = "updateCertificate";

    public static final Event STUDENTRECORDCREATED_EVENT = new Event("StudentRecordCreated", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event CERTIFICATEISSUED_EVENT = new Event("CertificateIssued", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Address>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}));
    ;

    public static final Event CERTIFICATEREVOKED_EVENT = new Event("CertificateRevoked", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
    ;

    public static final Event CERTIFICATEUPDATED_EVENT = new Event("CertificateUpdated", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Utf8String>() {}, 
            new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, 
            new TypeReference<Bytes32>() {}, new TypeReference<Bool>() {}));
    ;

    protected EducationCertification(String contractAddress, Client client, CryptoKeyPair credential) {
        super(getBinary(client.getCryptoSuite()), contractAddress, client, credential);
    }

    public static String getBinary(CryptoSuite cryptoSuite) {
        return (cryptoSuite.getCryptoTypeConfig() == CryptoType.ECDSA_TYPE ? BINARY : SM_BINARY);
    }

    public TransactionReceipt revokeCertificate(BigInteger _certificateId) {
        final Function function = new Function(
                FUNC_REVOKECERTIFICATE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_certificateId)), 
                Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public void revokeCertificate(BigInteger _certificateId, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_REVOKECERTIFICATE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_certificateId)), 
                Collections.<TypeReference<?>>emptyList());
        asyncExecuteTransaction(function, callback);
    }

    public String getSignedTransactionForRevokeCertificate(BigInteger _certificateId) {
        final Function function = new Function(
                FUNC_REVOKECERTIFICATE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_certificateId)), 
                Collections.<TypeReference<?>>emptyList());
        return createSignedTransaction(function);
    }

    public Tuple1<BigInteger> getRevokeCertificateInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_REVOKECERTIFICATE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple1<BigInteger>(

                (BigInteger) results.get(0).getValue()
                );
    }

    public Tuple5<String, String, String, String, Boolean> getCertificate(BigInteger _certificateId) throws ContractException {
        final Function function = new Function(FUNC_GETCERTIFICATE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_certificateId)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Bool>() {}));
        List<Type> results = executeCallWithMultipleValueReturn(function);
        return new Tuple5<String, String, String, String, Boolean>(
                (String) results.get(0).getValue(), 
                (String) results.get(1).getValue(), 
                (String) results.get(2).getValue(), 
                (String) results.get(3).getValue(), 
                (Boolean) results.get(4).getValue());
    }

    public Tuple8<BigInteger, String, String, String, String, String, byte[], Boolean> certificates(BigInteger param0) throws ContractException {
        final Function function = new Function(FUNC_CERTIFICATES, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(param0)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Address>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Bytes32>() {}, new TypeReference<Bool>() {}));
        List<Type> results = executeCallWithMultipleValueReturn(function);
        return new Tuple8<BigInteger, String, String, String, String, String, byte[], Boolean>(
                (BigInteger) results.get(0).getValue(), 
                (String) results.get(1).getValue(), 
                (String) results.get(2).getValue(), 
                (String) results.get(3).getValue(), 
                (String) results.get(4).getValue(), 
                (String) results.get(5).getValue(), 
                (byte[]) results.get(6).getValue(), 
                (Boolean) results.get(7).getValue());
    }

    public BigInteger nextCertificateId() throws ContractException {
        final Function function = new Function(FUNC_NEXTCERTIFICATEID, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeCallWithSingleValueReturn(function, BigInteger.class);
    }

    public Tuple5<String, String, String, BigInteger, Boolean> students(String param0) throws ContractException {
        final Function function = new Function(FUNC_STUDENTS, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Address(param0)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}, new TypeReference<Bool>() {}));
        List<Type> results = executeCallWithMultipleValueReturn(function);
        return new Tuple5<String, String, String, BigInteger, Boolean>(
                (String) results.get(0).getValue(), 
                (String) results.get(1).getValue(), 
                (String) results.get(2).getValue(), 
                (BigInteger) results.get(3).getValue(), 
                (Boolean) results.get(4).getValue());
    }

    public TransactionReceipt issueCertificate(String _studentId, String _certificateType, String _certificateNumber, String _issueDate, String _institution, byte[] _hash) {
        final Function function = new Function(
                FUNC_ISSUECERTIFICATE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Address(_studentId), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_certificateType), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_certificateNumber), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_issueDate), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_institution), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Bytes32(_hash)), 
                Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public void issueCertificate(String _studentId, String _certificateType, String _certificateNumber, String _issueDate, String _institution, byte[] _hash, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_ISSUECERTIFICATE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Address(_studentId), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_certificateType), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_certificateNumber), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_issueDate), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_institution), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Bytes32(_hash)), 
                Collections.<TypeReference<?>>emptyList());
        asyncExecuteTransaction(function, callback);
    }

    public String getSignedTransactionForIssueCertificate(String _studentId, String _certificateType, String _certificateNumber, String _issueDate, String _institution, byte[] _hash) {
        final Function function = new Function(
                FUNC_ISSUECERTIFICATE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Address(_studentId), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_certificateType), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_certificateNumber), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_issueDate), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_institution), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Bytes32(_hash)), 
                Collections.<TypeReference<?>>emptyList());
        return createSignedTransaction(function);
    }

    public Tuple6<String, String, String, String, String, byte[]> getIssueCertificateInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_ISSUECERTIFICATE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Bytes32>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple6<String, String, String, String, String, byte[]>(

                (String) results.get(0).getValue(), 
                (String) results.get(1).getValue(), 
                (String) results.get(2).getValue(), 
                (String) results.get(3).getValue(), 
                (String) results.get(4).getValue(), 
                (byte[]) results.get(5).getValue()
                );
    }

    public Boolean verifyCertificate(BigInteger _certificateId, byte[] _hash) throws ContractException {
        final Function function = new Function(FUNC_VERIFYCERTIFICATE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_certificateId), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Bytes32(_hash)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bool>() {}));
        return executeCallWithSingleValueReturn(function, Boolean.class);
    }

    public Tuple3<String, String, BigInteger> getStudentRecord(String _studentId) throws ContractException {
        final Function function = new Function(FUNC_GETSTUDENTRECORD, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Address(_studentId)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}));
        List<Type> results = executeCallWithMultipleValueReturn(function);
        return new Tuple3<String, String, BigInteger>(
                (String) results.get(0).getValue(), 
                (String) results.get(1).getValue(), 
                (BigInteger) results.get(2).getValue());
    }

    public TransactionReceipt createStudentRecord(String _studentId, String _name, String _education, BigInteger _graduationYear) {
        final Function function = new Function(
                FUNC_CREATESTUDENTRECORD, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Address(_studentId), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_name), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_education), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_graduationYear)), 
                Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public void createStudentRecord(String _studentId, String _name, String _education, BigInteger _graduationYear, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_CREATESTUDENTRECORD, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Address(_studentId), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_name), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_education), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_graduationYear)), 
                Collections.<TypeReference<?>>emptyList());
        asyncExecuteTransaction(function, callback);
    }

    public String getSignedTransactionForCreateStudentRecord(String _studentId, String _name, String _education, BigInteger _graduationYear) {
        final Function function = new Function(
                FUNC_CREATESTUDENTRECORD, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Address(_studentId), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_name), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_education), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_graduationYear)), 
                Collections.<TypeReference<?>>emptyList());
        return createSignedTransaction(function);
    }

    public Tuple4<String, String, String, BigInteger> getCreateStudentRecordInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_CREATESTUDENTRECORD, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple4<String, String, String, BigInteger>(

                (String) results.get(0).getValue(), 
                (String) results.get(1).getValue(), 
                (String) results.get(2).getValue(), 
                (BigInteger) results.get(3).getValue()
                );
    }

    public String admin() throws ContractException {
        final Function function = new Function(FUNC_ADMIN, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
        return executeCallWithSingleValueReturn(function, String.class);
    }

    public List<StudentRecordCreatedEventResponse> getStudentRecordCreatedEvents(TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(STUDENTRECORDCREATED_EVENT, transactionReceipt);
        ArrayList<StudentRecordCreatedEventResponse> responses = new ArrayList<StudentRecordCreatedEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            StudentRecordCreatedEventResponse typedResponse = new StudentRecordCreatedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.studentId = (String) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.name = (String) eventValues.getNonIndexedValues().get(1).getValue();
            typedResponse.education = (String) eventValues.getNonIndexedValues().get(2).getValue();
            typedResponse.graduationYear = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public void subscribeStudentRecordCreatedEvent(String fromBlock, String toBlock, List<String> otherTopics, EventCallback callback) {
        String topic0 = eventEncoder.encode(STUDENTRECORDCREATED_EVENT);
        subscribeEvent(ABI,BINARY,topic0,fromBlock,toBlock,otherTopics,callback);
    }

    public void subscribeStudentRecordCreatedEvent(EventCallback callback) {
        String topic0 = eventEncoder.encode(STUDENTRECORDCREATED_EVENT);
        subscribeEvent(ABI,BINARY,topic0,callback);
    }

    public List<CertificateIssuedEventResponse> getCertificateIssuedEvents(TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(CERTIFICATEISSUED_EVENT, transactionReceipt);
        ArrayList<CertificateIssuedEventResponse> responses = new ArrayList<CertificateIssuedEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            CertificateIssuedEventResponse typedResponse = new CertificateIssuedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.certificateId = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.studentId = (String) eventValues.getNonIndexedValues().get(1).getValue();
            typedResponse.certificateType = (String) eventValues.getNonIndexedValues().get(2).getValue();
            typedResponse.certificateNumber = (String) eventValues.getNonIndexedValues().get(3).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public void subscribeCertificateIssuedEvent(String fromBlock, String toBlock, List<String> otherTopics, EventCallback callback) {
        String topic0 = eventEncoder.encode(CERTIFICATEISSUED_EVENT);
        subscribeEvent(ABI,BINARY,topic0,fromBlock,toBlock,otherTopics,callback);
    }

    public void subscribeCertificateIssuedEvent(EventCallback callback) {
        String topic0 = eventEncoder.encode(CERTIFICATEISSUED_EVENT);
        subscribeEvent(ABI,BINARY,topic0,callback);
    }

    public List<CertificateRevokedEventResponse> getCertificateRevokedEvents(TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(CERTIFICATEREVOKED_EVENT, transactionReceipt);
        ArrayList<CertificateRevokedEventResponse> responses = new ArrayList<CertificateRevokedEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            CertificateRevokedEventResponse typedResponse = new CertificateRevokedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.certificateId = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public void subscribeCertificateRevokedEvent(String fromBlock, String toBlock, List<String> otherTopics, EventCallback callback) {
        String topic0 = eventEncoder.encode(CERTIFICATEREVOKED_EVENT);
        subscribeEvent(ABI,BINARY,topic0,fromBlock,toBlock,otherTopics,callback);
    }

    public void subscribeCertificateRevokedEvent(EventCallback callback) {
        String topic0 = eventEncoder.encode(CERTIFICATEREVOKED_EVENT);
        subscribeEvent(ABI,BINARY,topic0,callback);
    }

    public TransactionReceipt updateCertificate(BigInteger _certificateId, String _certificateType, 
            String _certificateNumber, String _issueDate, String _institution, byte[] _hash, Boolean _isValid) {
        final Function function = new Function(
                FUNC_UPDATECERTIFICATE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_certificateId),
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_certificateType),
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_certificateNumber),
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_issueDate),
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_institution),
                new org.fisco.bcos.sdk.abi.datatypes.generated.Bytes32(_hash),
                new org.fisco.bcos.sdk.abi.datatypes.Bool(_isValid)),
                Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public void updateCertificate(BigInteger _certificateId, String _certificateType, 
            String _certificateNumber, String _issueDate, String _institution, byte[] _hash, Boolean _isValid, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_UPDATECERTIFICATE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_certificateId),
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_certificateType),
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_certificateNumber),
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_issueDate),
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_institution),
                new org.fisco.bcos.sdk.abi.datatypes.generated.Bytes32(_hash),
                new org.fisco.bcos.sdk.abi.datatypes.Bool(_isValid)),
                Collections.<TypeReference<?>>emptyList());
        asyncExecuteTransaction(function, callback);
    }

    public String getSignedTransactionForUpdateCertificate(BigInteger _certificateId, String _certificateType, 
            String _certificateNumber, String _issueDate, String _institution, byte[] _hash, Boolean _isValid) {
        final Function function = new Function(
                FUNC_UPDATECERTIFICATE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_certificateId),
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_certificateType),
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_certificateNumber),
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_issueDate),
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_institution),
                new org.fisco.bcos.sdk.abi.datatypes.generated.Bytes32(_hash),
                new org.fisco.bcos.sdk.abi.datatypes.Bool(_isValid)),
                Collections.<TypeReference<?>>emptyList());
        return createSignedTransaction(function);
    }

    public Tuple7<BigInteger, String, String, String, String, byte[], Boolean> getUpdateCertificateInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_UPDATECERTIFICATE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Utf8String>() {}, 
                new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, 
                new TypeReference<Bytes32>() {}, new TypeReference<Bool>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple7<BigInteger, String, String, String, String, byte[], Boolean>(
                (BigInteger) results.get(0).getValue(), 
                (String) results.get(1).getValue(), 
                (String) results.get(2).getValue(), 
                (String) results.get(3).getValue(), 
                (String) results.get(4).getValue(),
                (byte[]) results.get(5).getValue(),
                (Boolean) results.get(6).getValue());
    }

    public List<CertificateUpdatedEventResponse> getCertificateUpdatedEvents(TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = extractEventParametersWithLog(CERTIFICATEUPDATED_EVENT, transactionReceipt);
        ArrayList<CertificateUpdatedEventResponse> responses = new ArrayList<CertificateUpdatedEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            CertificateUpdatedEventResponse typedResponse = new CertificateUpdatedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.certificateId = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.certificateType = (String) eventValues.getNonIndexedValues().get(1).getValue();
            typedResponse.certificateNumber = (String) eventValues.getNonIndexedValues().get(2).getValue();
            typedResponse.issueDate = (String) eventValues.getNonIndexedValues().get(3).getValue();
            typedResponse.institution = (String) eventValues.getNonIndexedValues().get(4).getValue();
            typedResponse.hash = (byte[]) eventValues.getNonIndexedValues().get(5).getValue();
            typedResponse.isValid = (Boolean) eventValues.getNonIndexedValues().get(6).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public void subscribeCertificateUpdatedEvent(String fromBlock, String toBlock, List<String> otherTopics, EventCallback callback) {
        String topic0 = eventEncoder.encode(CERTIFICATEUPDATED_EVENT);
        subscribeEvent(ABI,BINARY,topic0,fromBlock,toBlock,otherTopics,callback);
    }

    public void subscribeCertificateUpdatedEvent(EventCallback callback) {
        String topic0 = eventEncoder.encode(CERTIFICATEUPDATED_EVENT);
        subscribeEvent(ABI,BINARY,topic0,callback);
    }

    public static EducationCertification load(String contractAddress, Client client, CryptoKeyPair credential) {
        return new EducationCertification(contractAddress, client, credential);
    }

    public static EducationCertification deploy(Client client, CryptoKeyPair credential) throws ContractException {
        return deploy(EducationCertification.class, client, credential, getBinary(client.getCryptoSuite()), "");
    }

    public static class StudentRecordCreatedEventResponse {
        public TransactionReceipt.Logs log;

        public String studentId;

        public String name;

        public String education;

        public BigInteger graduationYear;
    }

    public static class CertificateIssuedEventResponse {
        public TransactionReceipt.Logs log;

        public BigInteger certificateId;

        public String studentId;

        public String certificateType;

        public String certificateNumber;
    }

    public static class CertificateRevokedEventResponse {
        public TransactionReceipt.Logs log;

        public BigInteger certificateId;
    }

    public static class CertificateUpdatedEventResponse {
        public TransactionReceipt.Logs log;

        public BigInteger certificateId;

        public String certificateType;

        public String certificateNumber;
        
        public String issueDate;
        
        public String institution;
        
        public byte[] hash;
        
        public Boolean isValid;
    }
}
